#include "../includes/OTHER_TYPES/ARRAY/CHAR/UTF8.h"

int main(int argc, char * argv[])
{  
  CHECK_SYS_ENDIAN();
  
  // https://en.wikipedia.org/wiki/UTF-8
  
  // array with UTF8 encoded characters
  char real[20] = {'b', 'a', 0xC2, 0xA3, '>', 0xF4, 0x89, 0x9A, 0xB3, 0xE2, 0x82, 0xAC, 0xF0, 0x90, 0x8D, 0x88};
  for (int i = 0; i < 20; /**/)
  {
    print_enc_utf8(&real[0] + i, 20 - i);
    printf(" ");
    if (check_enc_utf8(&real[0] + i, 20 - i) == 0)
      break;
    i += check_enc_utf8(&real[0] + i, 20 - i);
  }
  
  // testing write_enc_utf8()
  utf8_int test = 0x1096B3;
  printf("\n%02X %02X\n", '>', ((byte *) write_enc_utf8(test, &real[0], 20))[0]);
  print_enc_utf8(&real[0], 20);
  printf("\n");
  
  return 0;
}
